
#ifndef ___FANXES_ARRAY_HELPER_H_
#define ___FANXES_ARRAY_HELPER_H_

template <class T>
bool Make2DArray( T ** &x, int rows, int cols )
{
    try {
        x = new T *[rows];
        for ( int i = 0; i < rows; ++i )
            x[i] = new int [cols];

        return true;
    } catch ( ... ) {
        return false;
    }
}

template <class T>
void Delete2DArray( T ** &x, int rows )
{
    for ( int r = 0; r < rows; ++r )
        delete [] x[r];
    delete [] x;
    x = 0;
}

#endif // ___FANXES_ARRAY_HELPER_H_

